<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/inc/common.jsp"%>
<html>
<head>
<title>班车管理</title>

<script type="text/javascript">
	//回车保存
	$(document).keydown(function(e){
		if(e.keyCode == 13) {
			saveDate();
		}
	});
	
	function saveDate(){
		var state = $("#state").combobox('getValue');
		var actionUrl = "${basePath}/bus/shuttle/save.do";
		$('#submitBtn').click(function(){return false;});
		$('#editForm').form('submit', {   
		     url:actionUrl,
		     onSubmit: function(){
		 		if(state == ""){
		 			$.messager.alert('消息', "请选择状态!");
		 			return false;
		 		}
		    	return $(this).form('validate');
		     },
		     success:function(msg){
		    	 if(msg == "success"){
		    		 $.messager.alert('消息', "保存成功!");
		    		 window.location.href="${basePath}/bus/shuttle/index.do";
		    	 }else{
		             $.messager.alert('消息', "系统异常,请联系管理员!");
		         }
		    }
		 });
	}

</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'center',title:'',footer:'#searchfooter'" >
		<div class="easyui-panel" data-options="fit:true,collapsible:true,title:'班车信息'"  style="padding:10px 10px 10px 10px;">
	   
	   <form id="editForm"  method="post">
	    	<input type="hidden" id="id" name="id" value="${shuttle.id}" />
	    	<table  style="width:100%;" cellpadding="0" cellspacing="1"  class="formtable">
				<tr>
					<td align="right" style="width: 10%">车牌号:</td>
					<td class="value">
					<input class="easyui-textbox" type="text" name="carNo" id="carNo" value="${shuttle.carNo}"  >
					</td>
				</tr>
				<tr>
					<td align="right" style="width: 10%">所属企业:</td>
					<td class="value">
					<input class="easyui-textbox" type="text" name="company" id="company" value="${shuttle.company}" data-options="required:true" >
					</td>
				</tr>
				<tr>
					<td align="right" style="width: 10%">状态:</td>
					<td class="value">
						<input class="easyui-combobox" id="state" name="state" value="${shuttle.state}" data-options="url:'<%=path%>/sys/dictionary/dicbykey.do?key=1008',method:'get',valueField:'dataCode',textField:'dataName',panelHeight:'auto',editable:false,required:true">
					</td>
		    	</tr>
				<tr>
					<td align="right" style="width: 10%">备注:</td>
					<td class="value">
						<input id="remark" name="remark" class="easyui-textbox" value="${shuttle.remark}" data-options="multiline:true" data-options="validType:'maxLength[150]'" style="height: 60px;"></input>
					</td>
		    	</tr>
	    	</table>
	    </form>
	</div>
	</div>
	<!-- 保存按钮 -->
	<div id="searchfooter" style="text-align:right;padding: 0px 10px">
		<a href="javascript:void(0)" id="submitBtn" class="easyui-linkbutton" onclick="saveDate()"  data-options="iconCls:'icon-page_save',plain:true" >保存</a>
		<span class="search-btn-separator"></span>
		<a href="javascript:history.go(-1)" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true">返回</a>
	</div>
</body>
</html>
